// pages/me/service/service.js
import util from '../../../utils/utils';
import Data from "../../../utils/data";
Page({
  /**
   * 页面的初始数据
   */
  autoAuth:false,
  data: {
    wechat:'',
    tel:'',
    time:'',
    question:[],
    activeNames:'1'
  },

  initPage: function () {
    let that = this;
    Data.getDictConfig('customer_question', function(res){
      //console.log(res);
      // let arrData = {content: "问题答案2", title: "问题标题2"}
      // for (let i = 0; i < 20; i++) {
      //   res.question.push(arrData);
        
      // }
      that.setData({
        wechat:res.wechat,
        tel:res.tel,
        time:res.time,
        question:res.question
      });
    }, true);

  },
  onChange(event) {
    console.log(event);
    
    this.setData({
      activeNames: event.detail
    });
  },
  //点击复制
  onClipboard:function(e){
    let that = this;
    console.log(that.data.wechat);
    wx.setClipboardData({
      data: that.data.wechat,
      success: function (res) {
        //关闭默认提示框
        //wx.hideToast();
        // wx.showModal({
        //   title: '提示',
        //   content: '复制成功',
        //   showCancel: false
        // });
      }
    })
  },
  //拨打电话
  onPhoneCall:function(e){
    let that = this;
    wx.makePhoneCall({
      phoneNumber: that.data.tel,
    })
  }
  
});
